<?php

!defined('DEBUG') AND exit('Access Denied.');

// 语言 / Language
$lang = include _include(APP_PATH."lang/$conf[lang]/bbs.php");

// 支持 Token 接口（token 与 session 双重登陆机制，方便 REST 接口设计，也方便 $_SESSION 使用）
$uid = intval(_SESSION('uid'));
empty($uid) AND $uid = user_token_get() AND $_SESSION['uid'] = $uid;
$user = user_read($uid);
//头部信息
$header = array(
	'title'=>$conf['sitename'],
	'keywords' => $conf['keywords'],
	'description' => $conf['sitebrief'],
);

// 检测站点运行级别
check_runlevel();

$route = param(0, 'index');

if(!defined('SKIP_ROUTE')) {

	// 按照使用的频次排序，增加命中率，提高效率
	switch ($route) {
		case 'pay': 		include _include(APP_PATH.'route/pay.php'); 			break;
		case 'index': 		include _include(APP_PATH.'route/index.php'); 			break;
		case 'static': 		include _include(APP_PATH.'route/static.php'); 			break;
		case 'article': 	include _include(APP_PATH.'route/article.php'); 		break;
		case 'user': 		include _include(APP_PATH.'route/user.php'); 			break;
		default:			include _include(APP_PATH.'route/index.php'); 			break;
	}
}

?>